﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Esint.Common.Data;
using System.Data;


namespace Esint.Common.Data
{
    public class WhereParameter : IRootWhereParameter, IWhereParameter
    {
        public WhereParameter(string whereExpression, string parameterName, object value, bool nullAndQuery)
        {
            ParameterName = parameterName;
            Value = value;
            WhereExpression = whereExpression;
            NullAndQuery = nullAndQuery;
        }

        public WhereParameter(string whereExpression, string parameterName, object value)
        {
            ParameterName = parameterName;
            Value = value;
            WhereExpression = whereExpression;
            NullAndQuery = false;
        }

        public WhereParameter(string parameterName, object value)
        {
            ParameterName = parameterName;
            Value = value;
            WhereExpression = "";
            NullAndQuery = false;
        }

        #region IRootWhereParameter 成员

        public bool NullAndQuery { get; set; }

        public string ParameterName { get; set; }

        public object Value { get; set; }

        public string WhereExpression { get; set; }

        private ParameterDirection _direction = ParameterDirection.Input;
        public ParameterDirection Direction { get { return _direction; } set { _direction = value; } }

        public int? Size { get; set; }
        
      //  public OracleDbType? DbType {get;set;}
        #endregion
    }
}
